#{extends 'CRUD/layout.html' /}
#{set title:messages.get('anamnesisdisease.edit') /}

<div id="crudShow" class="${type.name}">

    <h2 id="crudShowTitle">&{'anamnesisdisease.edit'}</h2>

    <div class="objectForm">
    #{form action:@save(object._key()), enctype:'multipart/form-data'}
        #{crud.form fields:['anamnesisDiseaseName', 'type', 'syndrome', 'anamnesisDiseaseDetails']}
        	#{crud.custom 'anamnesisDiseaseDetails'}
	    		<label for="anamnesisDiseaseDetails"><a href="@{AnamnesisDiseaseDetails.list()}" class="nonUnderlined">&{'objects.anamnesisdiseasedetails'}</a></label>
	    		%{anamnesisDiseaseDetails = models.AnamnesisDiseaseDetail.find("byAnamnesisDisease", object).fetch()}%
	    		#{if anamnesisDiseaseDetails != null && !anamnesisDiseaseDetails.isEmpty()}
	    		<div class="list">
					#{list items:anamnesisDiseaseDetails, as:'detail'}
			           	<li>
			           		<span id="${detail.anamnesisDiseaseDetailId}" class="hiddenLinks">
								@{AnamnesisDiseaseDetails.show(detail.anamnesisDiseaseDetailId)}
			        		</span>
			        		${detail.anamnesisDiseaseDetailName}
		        		</li>
				    #{/list}
				</div>
				#{/if}
	    		#{else}
					&{'crud.list.empty'}
				#{/else}
        	#{/crud.custom}
        #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
        </p>
    #{/form}
    </div>

    #{form @delete(object._key())}
        <p class="crudDelete">
            <input type="submit" value="&{'anamnesisdisease.delete'}" onclick="return confirm('&{'anamnesisdisease.delete'}')"/>
        </p>
    #{/form}

</div>